package valueobject

type UserOption func(u *User)

func NewUser(opts ...UserOption) UserVO {
	var user User
	for _, opt := range opts {
		opt(&user)
	}
	return &user
}

func WithUserName(name string) UserOption {
	return func(u *User) {
		u.Name = name
	}
}

func WithUserUsername(username string) UserOption {
	return func(u *User) {
		u.Username = username
	}
}

func WithUserRole(role uint) UserOption {
	return func(u *User) {
		u.Role = role
	}
}
